package com.eureka.healthprovider;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据库连接状态控制器，用于模拟设置数据库是否挂掉
 */
@RequestMapping("/db")
@RestController
public class DataBaseController {


    @GetMapping("/status/{status}")
    public boolean status(@PathVariable boolean status){
        //动态设置boolean值，模拟系统数据库是否正常
        DataBaseConstants.setStatus(status);
        return status;
    }


}
